-- destroy
-- created by panyl
-- 毁灭之刃

return {
    fetchProps = function(who, status, condition)
        local attack = tonumber(condition["attack"]);
        local endRound = condition["end_round"];
        local props = {};
        local propId = PropM.getPropId("attrib3");

        if attack > 0 then
            table.insert(props, { propId, "attack", attack, endRound, });
        end

        -- 不受反击
        propId = PropM.getPropId("cant_be_attack");
        table.insert(props, { propId, 1, 1000, endRound, });

        return props;
    end,

    clear = function(target, id, condition)
        EventMgr.fire(event.USER_INFO_UPDATED, "attack");
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 效果
        local value = condition["attack"];
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
